$OpenBSD: patch-digikam_libs_dimg_loaders_pngloader_cpp,v 1.1 2011/07/08 20:47:26 naddy Exp $

Fix build with png-1.5.

--- digikam/libs/dimg/loaders/pngloader.cpp.orig	Tue Jul  5 15:40:16 2011
+++ digikam/libs/dimg/loaders/pngloader.cpp	Tue Jul  5 15:44:42 2011
@@ -120,7 +120,7 @@ bool PNGLoader::load(const QString& filePath, DImgLoad
     // PNG error handling. If an error occurs during reading, libpng
     // will jump here
 
-    if (setjmp(png_ptr->jmpbuf))
+    if (setjmp(png_jmpbuf(png_ptr)))
     {
         DDebug() << k_funcinfo << "Internal libPNG error during reading file. Process aborted!" << endl;
         png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
@@ -252,7 +252,7 @@ bool PNGLoader::load(const QString& filePath, DImgLoad
 #ifdef ENABLE_DEBUG_MESSAGES
                 DDebug() << "PNG in PNG_COLOR_TYPE_GRAY" << endl;
 #endif
-                png_set_gray_1_2_4_to_8(png_ptr);
+                png_set_expand_gray_1_2_4_to_8(png_ptr);
                 png_set_gray_to_rgb(png_ptr);
 
                 if (QImage::systemByteOrder() == QImage::LittleEndian)       // Intel
@@ -403,7 +403,8 @@ bool PNGLoader::load(const QString& filePath, DImgLoad
 
     QMap<int, QByteArray>& metaData = imageMetaData();
 
-    png_charp   profile_name, profile_data=NULL;
+    png_charp   profile_name;
+    png_bytep   profile_data=NULL;
     png_uint_32 profile_size;
     int         compression_type;
 
@@ -526,7 +527,7 @@ bool PNGLoader::save(const QString& filePath, DImgLoad
     // PNG error handling. If an error occurs during writing, libpng
     // will jump here
 
-    if (setjmp(png_ptr->jmpbuf))
+    if (setjmp(png_jmpbuf(png_ptr)))
     {
         DDebug() << k_funcinfo << "Internal libPNG error during writing file. Process aborted!" << endl;
         fclose(f);
@@ -599,7 +600,7 @@ bool PNGLoader::save(const QString& filePath, DImgLoad
 
     if (!profile_rawdata.isEmpty())
     {
-        png_set_iCCP(png_ptr, info_ptr, (png_charp)"icc", PNG_COMPRESSION_TYPE_BASE, profile_rawdata.data(), profile_rawdata.size());
+        png_set_iCCP(png_ptr, info_ptr, (png_charp)"icc", PNG_COMPRESSION_TYPE_BASE, (png_bytep)profile_rawdata.data(), profile_rawdata.size());
     }
 
     // -------------------------------------------------------------------
